<?php
session_start();
include('connection.php');
if(isset($_SESSION['username']) || isset($_SESSION['password']))
{
?>
<html>
 <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">

    <title>Starter Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.css" rel="stylesheet">

    <!-- Custom styles for this template -->
   

    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../../docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
    
       <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>

         <script src="js/bootstrap.js"></script>  
       
    
  </head>
  <body>
<?php include('addminmenu.php'); ?>

<?php
	
if($_GET['list'])
{
$list=$_GET['list'];
 if ($list=='event')
 {
?>

<div class="container" style="margin-top:107px;">
<div><a href="module.php">Module</a> >> News </div><div class=""><a href="newsform.php"><input type="button" class="btn btn-success pull-right" value="Insert New News"> </div>
	<div class="row">
    <div class="col-sm-8 col-sm-offset-2">
<div class="table">

	<?php
					
					
	
$sql="SELECT * from $list";
$result=mysql_query($sql,$con);
 echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
 echo "<tr><th>Title</th><th>Status</th><th>Start Date</th><th>Expire Date</th><th>Delete News</th><th>Edit News</th>		</tr>";
 while($row=mysql_fetch_array($result))
{
echo "<tr><td>" .$row['title']."</td><td>".$row['status']."</td><td>".$row['start_date']."</td><td>".$row['expire_date']."</td><td><a href='deleteevent.php?event_id=".$row['event_id']."' class='ico del'>Delete</a></td><td><a href='editevent.php?event_id=".$row['event_id']."' class='ico edit'>Edit</a></td></tr>";	
}
echo "</table>";
}
?>
</div>
                    </div>
                    </div> </div>
                    
                    <?php
 if ($list=='course')
{	
					?>
                    <div class="container" style="margin-top:107px;">
<div><a href="module.php">Catalog</a> >> Course </div><div class=""><a href="addnewcourse.php"><input type="button" class="btn btn-success pull-right" value="Insert New Course"></a> </div>
	<div class="row">
    <div class="col-sm-8 col-sm-offset-2">
<div class="table">

<?php



$sql="SELECT * from $list";
$result=mysql_query($sql,$con);
 echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
 echo "<tr><th>Course Name</th><th>Course Fees</th><th>Course Duration </th><th>Course Batch</th><th>Delete Course</th><th>Edit Course</th>		</tr>";
 while($row=mysql_fetch_array($result))
{
echo "<tr><td>" .$row['course_name']."</td><td>".$row['course_fees']."</td><td>".$row['course_duration']."</td><td>Course batch</td><td><a href='deleteevent.php?course_id=".$row['course_id']."' class='ico del'>Delete</a></td><td><a href='editevent.php?course_id=".$row['course_id']."' class='ico edit'>Edit</a></td></tr>";	
}
echo "</table>";
}
}
?>
					</div>
                    </div>
                    </div>
                    </div>
                    <?PHP

}
else
{	header("location:index.php");
}
?>
</body>
</html>